package com.fsnbigdata.service.api;

import com.fsnbigdata.domain.ConservationStatus;
import com.fsnbigdata.domain.Distribution;
import com.fsnbigdata.domain.Germplasm;
import com.fsnbigdata.domain.Organism;
import com.fsnbigdata.domain.OrganismDocument;
import com.fsnbigdata.domain.OrganismImage;
import com.fsnbigdata.domain.OrganismSpecimen;
import com.fsnbigdata.domain.OrganismVideo;
import com.fsnbigdata.domain.Taxonomy;
import com.fsnbigdata.domain.dto.NamingPair3;
import com.querydsl.core.types.Predicate;
import io.springlets.data.domain.GlobalSearch;
import io.springlets.format.EntityResolver;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.roo.addon.layers.service.annotations.RooService;

/**
 * = OrganismService
 *
 * TODO Auto-generated class documentation
 *
 */
@RooService(entity = Organism.class)
public interface OrganismService extends EntityResolver<Organism, Long> {

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return Organism
     */
    @Override
    public abstract Organism findOne(Long id);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     */
    public abstract void delete(Organism organism);

    /**
     * TODO Auto-generated method documentation
     *
     * @param entities
     * @return List
     */
    public abstract List<Organism> save(Iterable<Organism> entities);

    /**
     * TODO Auto-generated method documentation
     *
     * @param ids
     */
    public abstract void delete(Iterable<Long> ids);

    /**
     * TODO Auto-generated method documentation
     *
     * @param entity
     * @return Organism
     */
    public abstract Organism save(Organism entity);

    /**
     * TODO Auto-generated method documentation
     *
     * @param id
     * @return Organism
     */
    public abstract Organism findOneForUpdate(Long id);

    /**
     * TODO Auto-generated method documentation
     *
     * @param ids
     * @return List
     */
    public abstract List<Organism> findAll(Iterable<Long> ids);

    /**
     * TODO Auto-generated method documentation
     *
     * @return List
     */
    public abstract List<Organism> findAll();

    /**
     * TODO Auto-generated method documentation
     *
     * @return Long
     */
    public abstract long count();

    /**
     *
     * @param predicate
     * @param pageable
     * @return
     */
    public abstract Page<Organism> search(Predicate predicate, Pageable pageable);

    /**
     * @param globalSearch
     * @param pageable
     * @return
     */
    public abstract Page<Organism> findAll(GlobalSearch globalSearch, Pageable pageable);


    /**
     * TODO Auto-generated method documentation
     *
     * @param globalSearch
     * @param pageable
     * @return Page
     */
    public abstract Page<Organism> findAll(GlobalSearch globalSearch, Pageable pageable, String creator);

    /**
     * TODO Auto-generated method documentation
     *
     * @param ids
     * @param globalSearch
     * @param pageable
     * @return Page
     */
    public abstract Page<Organism> findAllByIdsIn(List<Long> ids, GlobalSearch globalSearch, Pageable pageable);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param conservationStatusToAdd
     * @return Organism
     */
    public abstract Organism addToConservationStatus(Organism organism, Iterable<ConservationStatus> conservationStatusToAdd);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param conservationStatusToRemove
     * @return Organism
     */
    public abstract Organism removeFromConservationStatus(Organism organism, Iterable<Long> conservationStatusToRemove);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param distributionToAdd
     * @return Organism
     */
    public abstract Organism addToDistribution(Organism organism, Iterable<Distribution> distributionToAdd);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param distributionToRemove
     * @return Organism
     */
    public abstract Organism removeFromDistribution(Organism organism, Iterable<Long> distributionToRemove);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param docsToAdd
     * @return Organism
     */
    public abstract Organism addToDocs(Organism organism, Iterable<Long> docsToAdd);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param docsToRemove
     * @return Organism
     */
    public abstract Organism removeFromDocs(Organism organism, Iterable<Long> docsToRemove);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param docs
     * @return Organism
     */
    public abstract Organism setDocs(Organism organism, Iterable<Long> docs);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param documentsToAdd
     * @return Organism
     */
    public abstract Organism addToDocuments(Organism organism, Iterable<OrganismDocument> documentsToAdd);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param documentsToRemove
     * @return Organism
     */
    public abstract Organism removeFromDocuments(Organism organism, Iterable<Long> documentsToRemove);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param germplasmToAdd
     * @return Organism
     */
    public abstract Organism addToGermplasm(Organism organism, Iterable<Germplasm> germplasmToAdd);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param germplasmToRemove
     * @return Organism
     */
    public abstract Organism removeFromGermplasm(Organism organism, Iterable<Long> germplasmToRemove);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param imagesToAdd
     * @return Organism
     */
    public abstract Organism addToImages(Organism organism, Iterable<OrganismImage> imagesToAdd);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param imagesToRemove
     * @return Organism
     */
    public abstract Organism removeFromImages(Organism organism, Iterable<Long> imagesToRemove);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param specimensToAdd
     * @return Organism
     */
    public abstract Organism addToSpecimens(Organism organism, Iterable<OrganismSpecimen> specimensToAdd);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param specimensToRemove
     * @return Organism
     */
    public abstract Organism removeFromSpecimens(Organism organism, Iterable<Long> specimensToRemove);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param taxonomyToAdd
     * @return Organism
     */
    public abstract Organism addToTaxonomy(Organism organism, Iterable<Taxonomy> taxonomyToAdd);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param taxonomyToRemove
     * @return Organism
     */
    public abstract Organism removeFromTaxonomy(Organism organism, Iterable<Long> taxonomyToRemove);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param videosToAdd
     * @return Organism
     */
    public abstract Organism addToVideos(Organism organism, Iterable<OrganismVideo> videosToAdd);

    /**
     * TODO Auto-generated method documentation
     *
     * @param organism
     * @param videosToRemove
     * @return Organism
     */
    public abstract Organism removeFromVideos(Organism organism, Iterable<Long> videosToRemove);

    /**
     * TODO Auto-generated method documentation
     *
     * @param name
     * @param pageable
     * @return Page
     */
    public abstract Page<String> findNameByNameLike(String name, Pageable pageable);

    /**
     * TODO Auto-generated method documentation
     *
     * @param name
     * @return Long
     */
    public abstract long countByNameLike(String name);

    public List<NamingPair3> findAllByInitial(String initial);

    Object queryById(Long s);

    //Page<Organism> findByPageAndSize(String creator,String name, Pageable pageable);//分页查询

    List getPageList(String city,Pageable pageable);

    List getPageList1(List<Long> ids,Pageable pageable);

    List findByPageAndSize(String latinName, String kingdom, String family, String genus, String country, String province, String city, String name, Pageable pageable1);

    List getCountByPhylumn(String phylumn);

    List getCountByUseValue(String useValue);

//    List getOrganismAndTaxonomyByCityAndCountry(String city,String county,String family,String genus,Pageable pageable);

    List getTree(String city, String county, String kingdom, String phylumn, String tClass, String tOrder, String family);
    List getOrganismAndTaxonomyByCityAndCountry(String city,String county,String kingdom,String phylumn,String tClass,String tOrder,String family,String genus,Pageable pageable);
}
